package br.com.caelum.vraptor.components;

import java.io.Serializable;

import javax.enterprise.context.SessionScoped;
import javax.inject.Named;

import br.com.caelum.vraptor.entidades.Professor;

@SessionScoped
@Named("professorsessioned")
public class ProfessorSessioned implements Serializable{
       
        private Professor professor;
       
        public void login(Professor professor){
                this.professor = professor;
        }
       
        public void logout(){
                this.professor = null;
        }
       
        public String getNome(){
                return professor.getNome();
        }
       
        public String getLogin(){
                return professor.getMatricula();
        }
       
        public boolean isLogado(){
                return professor != null;
        }

}
